<?php


namespace App\Model;


/**
 * App\Model\User
 *
 * @property int $id
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property string $phone 用户手机号，用户唯一标识
 * @property string $img 头像
 * @property string|null $nickname 昵称
 * @property-read \App\Model\WeappToken $weapp_token
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\User newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\User newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\User query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\User whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\User whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\User whereImg($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\User whereNickname($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\User wherePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\User whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property-read \App\Model\WeappToken $kk
 * @property-read int|null $weapp_token_count
 */
class User extends Base
{

    protected $table='user';

    protected $fillable=['phone','img','nickname'];


    function weapp_token(){


        return $this->hasMany(WeappToken::class,'user_id','id');
    }


    function kk(){

        return $this->hasOne(WeappToken::class,'user_id','id');
    }

}
